I had downloaded a ".iso" image of the ubuntu website and for some official work i need to convert this to ".img" format. i see a lot of windows software's available but how do i do this conversion in linux?
Jovin Miranda's questions
Currently using csh at workplace.
So what i currently have is a path stored in the first line of a file and i am trying to read that.
head -n 1 jvar.txt
Now i have to go to that path so i was trying to store this in a variable
set a = head -n 1 jvar.txt
but its not able to store it in sayin Illegal variable name. The idea was to then do cd $a and go to that path. is there any way i can store it to something so i can cd to that path.
I have the following script. It's a simple test case where a
is any string value and b
is supposed to be a path.
#!/bin/bash
alias jo "\
echo "please enter values "\
read a \
read -e b \
echo "My values are $a and $b""
However whenever I try to execute ./sample.sh I get the following errors:
./sample.sh: line 3: alias: jo: not found
./sample.sh: line 3: alias: echo please: not found
./sample.sh: line 3: alias: enter: not found
./sample.sh: line 3: alias: values: not found
./sample.sh: line 3: alias: read a read -e b echo My: not found
./sample.sh: line 3: alias: values: not found
./sample.sh: line 3: alias: are: not found
./sample.sh: line 3: alias: and: not found
./sample.sh: line 3: alias: : not found
and when I try source sample.sh
I get the following:
a: Undefined variable.
My aim was to make this an alias so that I can source this script and just run the alias to execute the line of commands. Can someone look at this and let me know what the error is?
Hey everyone i have this issue where i have a sample program in csh (i know its not the best language to use for scripting but i dont have an option here) its as foll:
#!/bin/csh
echo 'please enter values'
read a
read -e b
echo "My values are $a and $b"
As you might see my second read is going to take a file input. This is needed as my actual program will have that; now what i want to do is to convert this to alias however when i execute the above script i get the foll. output
please enter values
read: Command not found
read: Command not found
a: Undefined variable
How can i fix this and also i want to convert this all 4 lines into a multiline alias. I have written single line alias in the past with no issues but not sure about multiline. if someone can help out i'll be really grateful
This is a sample straight forward program. I am using C-shell and want a solution for this environment itself. Following this code sample:
set FILENAME = "\!:2"
alias jo 'echo this is my \!:1 file and its name is $FILENAME'
on command line when I give the following:
jo first sample.txt
I should get the output as
this is my first file and its name is sample.txt
instead I get
this is my first file and its name is !:2
The problem here is the symbol \ totally gets eliminated, I don't know how. That is needed if I want it to take the argument. Can anyone help out with this?