A script is a sequence of commands or instructions that are executed by an interpreter program rather than compiled into a standalone executable program.
Script are supposed to be smaller program, easy to write and useful for specific and daily tasks.
I have a very big file and I want to remove if the column value is 9.
Sample:
My file value like this:
1 5 8 3 5 9 5 7 6 9
2 5 7 4 2 9 7 6 3 1
5 9 7 4 1 9 5 7 9 1
I want to delete any columns where the value, on all rows, is 9 ( my column size is…
I'm trying to prefix and append blocks of text to a list of files. Here is where I am so far. The sticking point is the sed -i "1i \$prefix" "$file" && line. sed won't substitute the value of prefix in. I tried to follow various threads about this…
I'm Using Unix script command to record everything which is output to the terminal and place it in a log file. but when I see recorded file, it also include Junk Character.
So how to record terminal activity without Junk Character.
Output Example…
I have a file containing list of URLs (one entry in one line).
After processing it to extract the host- (server-)names
with the script below (which works correctly),
the host names that appeared multiple times in the input
were appearing multiple…
What is the significance of importance of the command export COLUMNS ?
What I know is that it's a global variable.
I frequently see it in the beginning of *nix scripts.
First I made a file called telephone containing:
Jan;032569874
Annemie;014588529
Hans;015253694
Stefaan;011802367
And what I now need to do is make a script where the user inputs a name and the output should look like,
The phone number…
I can neither code Bash nor Python (actually, I am only comfortable with C-like syntax), and, actually, am too busy and lazy to learn them now. But I would like to script some tasks. Is there a scripting language for GNU/Linux, having obvious and…
How can I output that what shell is used to execute a script?
Ex.: the $SHELL variable gives that what is the default shell for the given user. That is ok, but the given user can launch the script with other shell, ex.: "sh script.sh" or "csh…
I am trying to move to intermediate level by learning the shell commands.
In online Linux forums it's often the consensus that to be an advanced Linux user one should know scripting. I myself have no experience with scripting the OS and don't know…
I’m looking for a variant of /dev/null that causes read to block forever, rather than returning EOF immediately. Does such a device exist?
I could probably create a named pipe (via mkfifo) to achieve the desired effect, but I’d rather not have to…
I have a bluetooth headset and I need to execute a .sh file everytime I connect it to make it work. I don't want to troubleshoot this bug since I know there's already people looking into it.
But I'm interested on a way to run that .sh script every…
I have two lines, which are saved in two variables. But it doesn't really matter, where they are saved. My question is, how do I compare each character from both lines?
For examples
Hello
Hlleo
result: true (H), false ... ,true (o)
Can somebody please help me with the below conversion shell script ?
Source File File 1 : for example
EXCHANGE_ID : 192, 410,
EXCHANGE_DTTM : 2015-06-11+02:18:40+0000, 2015-06-11+02:12:28+0000,
PART_NAME …
I am having a problem with an example script that is given in the textbook 'Unix and System Administration Handbook'. The script is below... I am receiving an error that states logscript: line 8: [: 1: unary operator expected.
# The log level is…